package com.sicheng.lc.周赛.分类.模拟;

/**
 * @author zsc
 * @version 1.0
 * @date 2022/7/31 10:33
 */
public class 使数组中所有元素都等于零 {
    //https://leetcode.cn/problems/make-array-zero-by-subtracting-equal-amounts/
    public int minimumOperations(int[] nums) {
        int[] map = new int[101];
        int cnt = 0;
        for (int x : nums) {
            if (x > 0 && map[x] == 0) {
                map[x]++;
                cnt++;
            }
        }
        return cnt;
    }
}
